package cn.wolfcode.luowowo.article.domain;

import cn.wolfcode.luowowo.cache.vo.AnswerStatisVO;
import cn.wolfcode.luowowo.comment.domain.CommunityComment;
import cn.wolfcode.luowowo.common.domain.BaseDomain;
import cn.wolfcode.luowowo.member.domain.UserInfo;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Getter
@Setter
public class Answer extends BaseDomain{


    private UserInfo user;

    private Ask ask;

    private String title;

    private AnswerContent content;

    private int gold = 0;

    private int topunm = 0;

    private int collectnum = 0;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date nowTime;

    private int status = 0;

    List<CommunityComment> comments = null;

    private AnswerStatisVO vo;



    public String getStatusString(){
        String s = "";
        if (status == 1){
            s = "发布";
        }else if(status == 0){
            s = "审核";
        }else if(status == -1){
            s = "拒绝";
        }
        return s;
    }

}